package com.ganeshkrishnan.globald.dao.hibernate;

import java.util.List;

import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.ganeshkrishnan.globald.abstracts.GenericDaoHibernate;
import com.ganeshkrishnan.globald.dao.CountryManagerDao;
import com.ganeshkrishnan.globald.model.CountryDetail;

@Repository
@Transactional
public class CountryManagerDaoHibernate extends GenericDaoHibernate<CountryDetail,Long> implements CountryManagerDao {
	public CountryManagerDaoHibernate() {
		super(CountryDetail.class);
	}
	
	@SuppressWarnings("unchecked")
	public CountryDetail findByCountryCode(String code)
	{
		List<CountryDetail> list =getHibernateTemplate().find(" from CountryDetail where cCode=?", code);
		if(null==list) return null;
		return list.get(0);
	}
}
